<?php
/**
 * FastApp.
 * 10/19/24
 * @Author deepsea159
 * @Contact telegram:deepsea159
 */

namespace App\Fastapp\Api\Service\Account;

use App\Fastapp\Api\Service\BaseService;
use App\Fastapp\Model\AccountFeedback;

class FeedbackService extends BaseService
{
    public function list(): array
    {
        $paginate = AccountFeedback::query()->where(['user_id' => get_uid()])->orderByDesc('id')->simplePaginate();
        return ['list' => $paginate->items()];
    }

    public function create(array $data): bool
    {
        $data['user_id'] = get_uid();
        AccountFeedback::query()->create($data);
        return true;
    }
}